package com.rabbitmq.sender;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;


@Service
public class InfoSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send(){

        String context = "hello " + new Date();

        System.out.println("Sender: " + context);

        this.rabbitTemplate.convertAndSend("hello",context);
    }

}
